package com.welab.springcloud.demo.goods.service;

import com.welab.springcloud.demo.dto.Goods;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

@Service
public class GoodsService {

    public Goods getGoods(Integer goodsId) {
        return Goods.builder().id(goodsId).goodsName("iPhoneX").price(5500).number(1).build();
    }

    public List<Goods> getUserGoods(Integer userId) {
        Goods iPhoneX = Goods.builder().id(10).goodsCode("1001").goodsName("iPhoneX").price(5500).number(1).build();
        Goods iWatch = Goods.builder().id(10).goodsCode("1002").goodsName("iWatch").price(5500).number(1).build();
        return Arrays.asList(iPhoneX,iWatch);
    }

}
